import { get, post } from '@/utils/request'
export default {
  namespaced: true,
  state: {
    orderList: [],
    orderDetailed: []
  },
  mutations: {
    GETORDERDATA(state, data) {
      state.orderList = JSON.parse(JSON.stringify(data))
      // console.log(data.list)
    },
    GETORDERDETAILED(state, data) {
      state.orderDetailed = data
      // console.log(data)
    }
  },
  actions: {
    async  getOrderDataAction({ commit }, param) {
      const res = await get('/order/pageQuery', param)
      // console.log(res.data)
      commit('GETORDERDATA', res.data)
    },

    async getOrderDetailedVuex({ commit }, param) {
      const res = await get('/order/pageQuery', param)
      commit('GETORDERDETAILED', res.data)
      console.log(res.data)
    }
  }
}
